home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
C++
/
Applications
/
PICSee Dust 1.01
/
Quaternary Source
/
TimerUtils.h
< prev
Wrap
Text File
|
1995-11-05
|
2KB
|
66 lines
#ifndef _TIMERUTILS_H_
#define _TIMERUTILS_H_
extern volatile Boolean gTimeNow;
typedef enum {
/* You can use the following rate constants, where the "XXX" in "kTimerRateXXXfps" is:
5, 10, 15, 20, 30, 40,
50, 59, 60, 67, 70, 71,
77, 80, 83, 90, 91, 100,
110, 111, 125, 140, 143,
167, 200, and 250 fps.
*/
kTimerRateOff = -1, // Turn off timing.
kTimerRate5fps = 200, // 5 frames per second; or 1000 millisecs / 200 == 5
kTimerRate10fps = 100, // 10 fps
kTimerRate15fps = 67, // 15 fps
kTimerRate20fps = 50,
kTimerRate25fps = 40,
kTimerRate30fps = 33, // 30 fps
kTimerRate40fps = 25,
kTimerRate50fps = 20,
kTimerRate59fps = 17,
kTimerRate67fps = 15,
kTimerRate71fps = 14,
kTimerRate77fps = 13,
kTimerRate83fps = 12,
kTimerRate91fps = 11,
kTimerRate100fps = 10,
kTimerRate111fps = 9,
kTimerRate125fps = 8,
kTimerRate143fps = 7,
kTimerRate167fps = 6,
kTimerRate200fps = 5,
kTimerRate250fps = 4,
// Just in case you only need approximate timings, in 10's.
// Basically synonyms in case you can't remember if its 111 or 110, etc.
kTimerRate60fps = kTimerRate59fps,
kTimerRate70fps = kTimerRate71fps,
kTimerRate80fps = kTimerRate83fps,
kTimerRate90fps = kTimerRate91fps,
kTimerRate110fps = kTimerRate111fps,
kTimerRate140fps = kTimerRate143fps,
kTimerRate150fps = kTimerRate167fps
} TimerRates;
// -----------------------------------------------------------------------
void SetTimerRate(short timerRate);
short GetTimerRate();
void SaveTimerRate();
void RestoreTimerRate();
// -----------------------------------------------------------------------
void StartTimer();
void StartTimer(short timerRate);
void StartTimerFPS(short fps); // Specifiy in frames per second
void ResetTimer(); // Or set gTimeNow = false
Boolean TimerDoNow(); // Or read gTimeNow directly
void StopTimer(); // Required
#endif // _TIMERUTILS_H_